<!DOCTYPE html>
<html >
<head>
	<meta charset="utf-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>{title}</title>
	<link href="{style_dir}bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
	<link rel="stylesheet" href="{style_dir}font-awesome/css/font-awesome.min.css"/>
	<link rel="stylesheet" href="images/style.css" />
	<link href="images/jquery.wizzy.css" rel="stylesheet">
	<link rel="icon" href="../favicon.ico" type="image/x-icon" />
	<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
	<script>
		var style_dir	= '{style_dir}';
	</script>
	<script src="{style_dir}js/global.js"></script>
	<script>
				//验证提交
		function FoundPHP_submit(){
			var error	= 0;
			$('input').each(function(){
				var req_name	= $(this).attr('required');
				if (req_name!=undefined){
					if($(this).val()==''){error =1;}
				}
			});
			
			password	= $('#password').val();
			if (password.length<5){
				sys_error('抱歉，管理员密码不能小于5位',1.5);
				$('#password').focus();
				return false;
			}
			if (error==0){
				layer.confirm("<lang>确定后系统会导入全新数据库<br>请先做好备份避免数据丢失。</lang>", function(index){
					$('#form').submit ();
				});
			}else{
					$('#form').submit ();
			}
			return false;
		}
	</script>
</head>
<body>
<form action="index.php?a={a}" id="form" method="post">
<input type="hidden" name="o" value="1"/>
	<div class="argument">
		<div class="container">
			<div class="col-md-12 col-sm-12 arg_bg">
				<div class="argument_title">
					<div class="pull-left arg_span">
						<span style="padding-right:10px;"><lang>FoundPHP FrameWork</lang></span><span style="border-left:solid 1px #fff;padding:0 0 0 10px;"><lang>安装向导</lang></span>
					</div>
					<div class="pull-right">
						<span><small>{FoundPHP_Ver}</small></span>
					</div>
					<div class="clearfix"></div>
				</div>
				<div class="step">
				<!-- Start Wizzy -->
				<div class="wz-wrapper wizzy">
					<div class="wz-inner">
							
							<div class="wz-step">
								
								<div class="col-md-12 col-xs-12 input-title">
									<lang>网站信息</lang>
								</div>
								<div class="col-md-12 col-xs-12">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>网站名称</lang>: <span style="color:red;">*</span></label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="site_name" class="form-control input_radius site_name" value="FoundPHP 建立的网站" required="required"/>
											</div>
									</div>
								</div>
								
								<div class="col-md-12 col-xs-12 input-other">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>网站地址</lang>: <span style="color:red;">*</span></label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="weburl" class="form-control input_radius weburl" value="{run:echo dirname(dirname(get_url()))}/" required="required"/>
											<small><lang>填写真实域名地址，地址最后保留斜杠</lang></small>
											</div>
									</div>
								</div>
								
								<div class="col-md-12 col-xs-12 input-other">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>网站作者</lang>:</label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="site_author" class="form-control input_radius site_name" value=""/>
											</div>
									</div>
								</div>
								
								<div class="col-md-12 col-xs-12 input-other">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>网站关键词</lang>:</label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="site_key" class="form-control input_radius" value=""/>
											</div>
									</div>
								</div>
								
								<div class="col-md-12 col-xs-12 input-other">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>网站介绍</lang>:</label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="site_desc" class="form-control input_radius" value=""/>
											</div>
									</div>
								</div>
								
								<div class="col-md-12 col-xs-12 input-title">
									<lang>数据库信息</lang>
								</div>
								<div class="col-md-12 col-xs-12">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>数据库类型</lang>: <span style="color:red;">*</span></label>
											<div class="col-md-9 col-sm-9 col-xs-12"><b>{dbtype}</b></div>
									</div>
								</div>
								<!-- IF(in_array($sel_db,array('mysql','mariadb','sqlsrv','pgsql'))) -->
								<div class="col-md-12 col-xs-12">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>数据库地址</lang>: <span style="color:red;">*</span></label>
											<div class="col-md-9 col-sm-9 col-xs-12">
												<input type="text" name="dbhost" class="form-control input_radius dbhost" style="width:47%;float:left;" value="127.0.0.1" required="required"/>
												<input type="text" name="dbport" class="form-control input_radius dbport" style="width:47%;float:right;" value="{dbport}" required="required"/>
												<small  style="width:100%;float:left;"><lang>默认数据库类型MYSQL</lang></small>
											</div>
									</div>
								</div>
								<div class="col-md-12 col-xs-12">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>数据库名称</lang>: <span style="color:red;">*</span></label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="dbname" class="form-control input_radius dbname" value="foundphp" required="required"/>
											</div>
									</div>
								</div>
								<div class="col-md-12 col-xs-12">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>数据库帐号/密码</lang>: <span style="color:red;">*</span></label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="dbuser" class="form-control input_radius dbuser" style="width:47%;float:left;" value="" placeholder="<lang>帐号</lang>" required="required"/>
											<input type="text" name="dbpass" class="form-control input_radius dbpass" style="width:47%;float:right;" placeholder="<lang>密码</lang>" autocomplete="off" value=""/>
											</div>
									</div>
								</div>
								<!-- END -->
								<!-- IF(in_array($sel_db,array('sqlite'))) -->
								<div class="col-md-12 col-xs-12">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>数据库位置</lang>: <span style="color:red;">*</span></label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="dbhost" class="form-control input_radius dbname" value="foundphp.sqlite3" required="required"/>
											</div>
									</div>
								</div>
								<!-- END -->
								<div class="col-md-12 col-xs-12 input-other">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>数据表前缀</lang>: <span style="color:red;">*</span></label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="pre" class="form-control input_radius" value="foundphp_"/>
											<small><lang>同一数据库运行多个项目，通过数据库前缀区分</lang></small>
											</div>
									</div>
								</div>
								
								<div class="col-md-12 col-xs-12 input-title">
									<lang>管理员信息</lang>
								</div>
								
								
								<div class="col-md-12 col-xs-12">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>管理员账号</lang>: <span style="color:red;">*</span></label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="adminuser" class="form-control input_radius adminuser" value="admin" required="required"/>
											</div>
									</div>
								</div>
								
								<div class="col-md-12 col-xs-12">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>管理员密码</lang>: <span style="color:red;">*</span></label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="password" id="password" class="form-control input_radius password" style="width:70%;float:left;" required="required" value="" autocomplete="off"/>
											<button type="button" class="btn btn-primary" style="width:25%;float:right;" onclick="admin_pw(8)"><lang>随机</lang></button>
											<small  style="width:100%;float:left;"><lang>管理员密码不能为空</lang></small>
											</div>
									</div>
								</div>
								
								<div class="col-md-12 col-xs-12 input-other">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"><lang>管理员Email</lang>:</label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<input type="text" name="email" class="form-control input_radius"  value=""/>
											</div>
									</div>
								</div>
								
								
								<div class="col-md-12 col-xs-12 show_more">
									<div class="form-group">
										<label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
											<div class="col-md-9 col-sm-9 col-xs-12">
											<button type="button" class="btn" onclick="show_more()"><lang>更多设置</lang></button>
											</div>
									</div>
								</div>
								
							</div>
							
						</div>
					</div>
					<div class="input-btn">
						<button type="button" class="btn btn-default pull-left back" onclick="location='index.php?a=check'">上一步</button>
						<button type="button" onclick="FoundPHP_submit();return false;" class="bb btn btn-info pull-right" >安装</button>
					</div>
				</div>
				<!-- End Wizzy -->
				<div class="clearfix"></div>
				</div>
			FoundPHP Framework ©2005-2021 Support PHP5, PHP7, PHP8 | <a href="http://www.foundphp.com" target="_blank">http://www.foundphp.com</a>
			<br><br>
			</div>
		</div>
	</div>
</form>
</body>
<script src="../data/style/js/jquery.1.min.js" type="text/javascript"></script>
<script>
	
	//循环判断下一步
	$(function(){
		$('.wz-header nav a').addClass('active');
		$('.progress').css({'width':'100% '});
		
		//绑定回车动作
		$('#form').keydown(function(event){
			if(event.which==13){
				FoundPHP_submit();
			}
		});
	})
	//随机密码
	function admin_pw(pasLen) {
		var pasArr = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9','@'];
		var password = '';
		var pasArrLen = pasArr.length;
		for (var i=0; i<pasLen; i++){
		var x = Math.floor(Math.random()*pasArrLen);
		password += pasArr[x];
		}
		$(".password").val(password);
	}
	
	//显示更多
	function show_more(){
		$('.input-other').show(500);
		$('.show_more').hide();
	}
	
</script>
</html>